package com.aim.analysis.artifact;

import java.util.HashMap;
import java.util.Map;

/**
 * User: Avraham Shvartzon
 * Date: 12/15/14
 */
public enum Strategy {

    //strategyWithoutAllert
    WITHOUT_ALERT("withoutAllert"),
    ALERT_3_SEC("alert3SecBefore"),
    HEATING_GAME("heatingGame"),
    FPA("FPA"),
    GPA("GPA"),
    NPA("NPA");

    private final String[] displayNames;

    private Strategy(String... displayNames) {
        this.displayNames = displayNames;
    }

    private static Map<String,Strategy> namesToStrategy = new HashMap<String, Strategy>();
    static{
        for (Strategy strategy : values()) {
            for (String displayName : strategy.displayNames) {
                namesToStrategy.put(displayName, strategy);
            }
        }
    }

    public static Strategy get(String displayName){
        if (namesToStrategy.containsKey(displayName)){
            return namesToStrategy.get(displayName);
        }
        throw new RuntimeException("unknown strategy - " + displayName);
    }
}
